# 练习4：设计一个函数返回传入的列表中最大和第二大的元素的值。

def get_one_two(test_list):
    if test_list[0] > test_list[1]:
        one = test_list[0]
        two = test_list[1]
    else:
        one = test_list[1]
        two = test_list[0]
    for ele in test_list[2:]:
        if ele > one:
            one = ele
        elif ele > two:
            two = ele

    return one, two

if __name__ == '__main__':
    test_list = [1,2,3,4,7,5,4,2,1,0]
    one, two = get_one_two(test_list)
    print(one, two)